package com.cicadamob.contact.api.service;

import android.content.Context;
import android.os.AsyncTask;

public class APIAsynTask extends AsyncTask<Object, Void, BaseResultModel> {

	private Context mContext;
	private ICallBack callBack;
	private DoInBackground doFunction;
	
	public APIAsynTask(Context mContext,ICallBack callBack,DoInBackground doFunction){
		this.mContext=mContext;
		this.callBack=callBack;
		this.doFunction=doFunction;
	}
	@Override
	protected BaseResultModel doInBackground(Object... params) {
		// TODO Auto-generated method stub
		if(this.doFunction!=null){
			return doFunction.doInBackground(mContext);
		}
		return null;
	}
	@Override
	protected void onPostExecute(BaseResultModel result) {
		// TODO Auto-generated method stub
		super.onPostExecute(result);
		if(callBack!=null) callBack.respone(result);
		
	
	}
	
	

}
